@(users: List[User], userForm: Form[User])

@import helper._


@main("User list") {
    
    <h3>@users.size() User(s)</h3>
    
    
	<table class="table table-hover">
		<thead>
			<th>E-mail</th>
			<th>Role</th>
			<th> </th>
		</thead>
	@for(user <- users) {
		@if(user.getRole().getName() == "admin"){
			<tr class="danger">
		}
		@if(user.getRole().getName() == "worker"){
			<tr class="warning">
		}
		@if(user.getRole().getName() == "user"){
			<tr class="success">
		}
			<td>@user.getEmail()</td>
			<td >@user.getRole()</td>
			<td>@form(controllers.user.routes.UserController.deleteUser(user.getId())) {
						@if(user.getRole().getName() == "admin"){
              <input class="btn btn-default btn-sm" disabled="disabled" type="submit" value="Delete">
						}else{
							<input class="btn btn-default btn-sm" type="submit" value="Delete">
						}
					}
			</td>
		</tr>
		}
	
	</table>

}
    